home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 267 < prev    next >
Text File  |  1996-08-06  |  1KB  |  35 lines

  1. Newsgroups: comp.std.c
  2. Path: in2.uu.net!siemens!mlg
  3. From: mlg@scr.siemens.com (Michael Greenberg)
  4. Subject: Are macros expanded within unused macro arguments?
  5. Message-ID: <DM3MC3.Atv@scr.siemens.com>
  6. Sender: news@scr.siemens.com (NeTnEwS)
  7. Nntp-Posting-Host: tucker.scr.siemens.com
  8. Organization: Siemens Corporate Research, Princeton, NJ
  9. Date: Thu, 1 Feb 1996 13:19:14 GMT
  10.  
  11.  
  12. Is the following program legal?
  13.  
  14. #define foo(unused)
  15. #define bar(x,y)
  16.  
  17. foo(bar(1))
  18.  
  19. Excerpt from "6.8.3.1 Argument substitution"
  20.  
  21.   After the arguments for the invocation of a function-like macro have
  22.   been identified, argument substitution takes place. A parameter in the
  23.   replacment list, ..., is replaced by the corresponding argument after
  24.   all macros contained therein have been expanded. Before being
  25.   substituted, each argument's preprocessing tokens are completely macro
  26.   replaced ... .
  27.  
  28.  
  29.  
  30. --
  31. Michael Greenberg                      email: mgreenberg@scr.siemens.com
  32. Siemens Corporate Research             phone: 609-734-3347
  33. 755 College Road East                  fax: 609-734-6565
  34. Princeton, NJ 08540
  35.